
<?php include '_sidebar.php' ?>
<?php if (array_key_exists("promociones", $contenido)) : ?>
    <div class="span10">
        <h2>Listado de promociones</h2>
        <table class="table-bordered">
            <thead>
                <?php foreach ($contenido["promociones"][0] as $key => $value) : ?>
                <th>
                    <?php echo $key ?>
                </th>
            <?php endforeach; ?>
            <th>Eliminar</th>
            </thead>

            <?php foreach ($contenido["promociones"] as $c) : ?>
                <tr style="cursor: pointer" onclick="window.location = 'index.php?modulo=promocion&accion=view&id_promo=<?php echo $c["id_promo"] ?>'">
                    <?php foreach ($c as $value) : ?>
                        <td>
                            <?php echo $value ?>
                        </td>
                    <?php endforeach; ?>
                    <td>
                        <form action="index.php?modulo=promocion&accion=delete" method="POST" style="margin: 0 0; text-align: center">
                            <button type="submit" class="btn btn-danger" name="id_promo" value="<?php echo $c["id_promo"] ?>">
                                <i class="icon-trash icon-white"></i>
                            </button>
                        </form>
                    </td>
                </tr>
            <?php endforeach; ?>
        </table>
    </div>
<?php endif; ?>